<?php 
include('config.php');
session_start();
if (isset($_GET['a'])) {
	$answers = mysql_query("SELECT * FROM fawri_answers where answer_id=".$_GET['a']."");
	
	$answer = mysql_fetch_array($answers) or die();
	if ($answer['iscorrect']=='y') {
		$sql="UPDATE `fawri_users` SET `user_score`=user_score+1 , last_access = now() WHERE user_fbid=".$_SESSION ['id']."";
		if(mysql_query($sql,$con))
		{}
		
	}

}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fawri | Question</title>
<!-- STYLES -->
<link rel="stylesheet" type="text/css" href="css/style.css" />

</head>

<body>

<!-- APP WARPER -->
<div class="warper"> 
  <!-- content left side -->
  <div class="left-side">
    <div class="question" style="text-align:center"> شكراً للمشاركة <br />
و أنتظر سؤال الغد!  </div>
    
    <!--back btn --> 
    <a href="nav.php" class="back"></a>
  </div>
  <div class="right-side"> <a href="#" class="logo "> </a>

    <?php 
	
    $comments = mysql_query("SELECT user_score FROM fawri_users where user_fbid=".$_SESSION ['id']."");
	$comment = mysql_fetch_array($comments);
	?>
    <span class="points"> <span><?php echo $comment['user_score']; ?></span> </span> </div>
    <? mysql_close($con); ?>
</div>
</body>
</html>
